﻿Imports System.IO
Imports System.Reflection
Public Class FileManagement
    Public Shared Sub CheckEnviorment()
        Dim tempPath As String = FileManagement.GetTempPath
        If Not Directory.Exists(tempPath) Then
            Directory.CreateDirectory(tempPath)
        End If
        For Each tempImage As String In Directory.GetFiles(tempPath)
            File.Delete(tempImage)
        Next
    End Sub
    Public Shared Function GetTempPath() As String
        Dim currentAppPath As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
        Return Path.Combine(currentAppPath, "captureit")
    End Function
    Public Shared Function GetTempFileName() As String
        Dim currentAppPath As String = FileManagement.GetTempPath
        Return Path.Combine(currentAppPath, Path.ChangeExtension(Guid.NewGuid.ToString, ".bmp"))
    End Function
End Class
